import Vue from 'vue'
import Router from 'vue-router'

//首页
// import Home from '@/pages/indexPage/home';
// import ProducDetails from '@/pages/indexPage/productDetails';
// import SearchPage from '@/pages/indexPage/searchPage';
// // import Category from '@/pages/CBmall/category';   //部门
// import Evaluate from '@/pages/indexPage/evaluate';  //评估

// 购物车
// import Cart from '@/pages/cartPage/cart';
// import Payment from '@/pages/cartPage/payment';
// import NoIdPayment from '@/pages/cartPage/noIdPayment';
// import PaymentCompleted from '@/pages/cartPage/paymentCompleted';

// 茶圈子
// import TcHome from '@/pages/teaCommunity/tcHome';
// // import TcContent from '@/pages/teaCommunity/tcContent'
// import TeaLife from  '@/pages/teaCommunity/teaLife';
// import Post from '@/pages/teaCommunity/post';
// import MsgContent from '@/pages/teaCommunity/msgContent';
// import Msgs from '@/pages/teaCommunity/msgs';

// 活动页
// import OnSale from '@/pages/activities/onSale'
// import CBimg from '@/pages/activities/CBimg';
// import Promotion from '@/pages/activities/promotion';
// import Active815 from '@/pages/activities/Active815';

//登录注册
// import Register from '@/pages/Login&Register/register';
// import Login from '@/pages/Login&Register/login';
// import MsgLogin from '@/pages/Login&Register/msgLogin';
// import ResetPassword from '@/pages/Login&Register/resetPassword';

// 个人中心
// import MyInfo from '@/pages/mine/myInfo';
// import MySet from '@/pages/mine/mySet';
// import MyCB from '@/pages/mine/myCB';
// import MyOrder from '@/pages/mine/myOrder';
// import MyCollection from '@/pages/mine/myCollection';
// import Coupon from '@/pages/mine/coupon';
// import HelpCenter from '@/pages/mine/HelpCenter';
// import MyAddress from '@/pages/mine/myAddress';
// import EditAddress from '@/pages/mine/editAddress';
// import CommentsBox from '@/pages/mine/commentsBox';
// import Preferences from '@/pages/mine/preferences';
// import Logistics from '@/pages/mine/logistics';

// 商城
// import CBmall from '@/pages/CBmall/CBmall';
// import CBmall1 from '@/pages/CBmall/CBmall1';
// import Mall from '@/pages/CBmall/mall';

// 入驻申请
// import Apply from '@/pages/settled/apply';


Vue.use(Router)

export default new Router({
  mode: 'history',  //历史管理模式:'hash'(浏览器环境)  'history'  'abstract'(Node.js环境)
  hashbang:false,
  routes: [
    //首页
    {path: '/', 
    component: r => require.ensure([], () => r(require("@/pages/indexPage/home")), 'h')},  //Mfooter, Mmode
    {path: '/Category', component: r => require.ensure([], () => r(require("@/pages/CBmall/category")), 'h')},  //Mfooter
    {path: '/SearchPage',component: r => require.ensure([], () => r(require("@/pages/indexPage/searchPage")), 'h')}, //Mmode, Mfooter
    {path: '/ProductDetails/:productID', component: r => require.ensure([], () => r(require("@/pages/indexPage/productDetails")), 'h')},  //Mheader
    {path: '/Evaluate/:orderId', component: r => require.ensure([], () => r(require("@/pages/indexPage/evaluate")), 'h')},
    
    //购物车
    {path:'/Cart', component: r => require.ensure([], () => r(require("@/pages/cartPage/cart")), 's')},
    {path:'/Payment', component: r => require.ensure([], () => r(require("@/pages/cartPage/payment")), 's')},
    {path:'NoIdPayment', component: r => require.ensure([], () => r(require("@/pages/cartPage/noIdPayment")), 's')},
    {path:'/PaymentCompleted', component: r => require.ensure([], () => r(require("@/pages/cartPage/paymentCompleted")), 's')},

    //茶友圈
    {path:'/TcHome', component: r => require.ensure([], () => r(require("@/pages/teaCommunity/tcHome")), 'c')},
    {path:'/TeaLife/:themeId', component: r => require.ensure([], () => r(require("@/pages/teaCommunity/teaLife")), 'c')},
    {path:'/MsgContent/:typeId', component: r => require.ensure([], () => r(require("@/pages/teaCommunity/msgContent")), 'c')},
    {path:'/Msgs', component: r => require.ensure([], () => r(require("@/pages/teaCommunity/msgs")), 'c')},
    {path:'/Promotion/:id', component: r => require.ensure([], () => r(require("@/pages/activities/promotion")), 'c')},
    {path:'/CBimg', component: r => require.ensure([], () => r(require("@/pages/activities/CBimg")), 'c')},
    {path:'/Active815', component: r => require.ensure([], () => r(require("@/pages/activities/Active815")), 'c')},

    //登录注册
    {path:'/Login', component: r => require.ensure([], () => r(require("@/pages/Login&Register/login")), 'd')},
    {path:'/MsgLogin', component: r => require.ensure([], () => r(require("@/pages/Login&Register/msgLogin")), 'd')},
    {path:'/Register', component: r => require.ensure([], () => r(require("@/pages/Login&Register/register")), 'd')},
    {path:'/ResetPassword', component: r => require.ensure([], () => r(require("@/pages/Login&Register/resetPassword")), 'd')},

    //个人中心
    {path:'/MyInfo', component: r => require.ensure([], () => r(require("@/pages/mine/myInfo")), 'p')},
    {path:'/Myset', component: r => require.ensure([], () => r(require("@/pages/mine/mySet")), 'p')},
    {path:'/MyCB', component: r => require.ensure([], () => r(require("@/pages/mine/myCB")), 'p')},
    {path:'/MyOrder/:title/:tabNum', component: r => require.ensure([], () => r(require("@/pages/mine/myOrder")), 'p')},
    {path:'/MyCollection', component: r => require.ensure([], () => r(require("@/pages/mine/myCollection")), 'p')},
    {path:'/MyAddress', component: r => require.ensure([], () => r(require("@/pages/mine/myAddress")), 'p')},
    {path:'/HelpCenter', component: r => require.ensure([], () => r(require("@/pages/mine/HelpCenter")), 'p')},
    {path:'EditAddress/:aId', component: r => require.ensure([], () => r(require("@/pages/mine/editAddress")), 'p')},
    {path:'/CommentsBox', component: r => require.ensure([], () => r(require("@/pages/mine/commentsBox")), 'p')},
    {path:'/Coupon', component: r => require.ensure([], () => r(require("@/pages/mine/coupon")), 'p')},
    {path:'/Preference/:title/:id', component: r => require.ensure([], () => r(require("@/pages/mine/preferences")), 'p')},
    {path:'/Logistics', component: r => require.ensure([], () => r(require("@/pages/mine/logistics")), 'p')},

    //商城
    {path:'/CBmall', component: r => require.ensure([], () => r(require("@/pages/CBmall/CBmall")), 'b')},
    {path:'/CBmall1', component: r => require.ensure([], () => r(require("@/pages/CBmall/CBmall1")), 'b')},
    {path:'/Mall', component: r => require.ensure([], () => r(require("@/pages/CBmall/mall")), 'b')},
    
    //入驻申请
    // {path:'/Apply', component: r => require.ensure([], () => r(require("@/pages/settled/apply")), 'r')}
    {path:'/Apply', component: () => import(/* webpackChunkName: "r" */ "@/pages/settled/apply")}
  ]
})
